﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Linq.Expressions;

namespace System.Web.Mvc.Html
{
    public static class LinkExtensions2
    {
        public static MvcHtmlString ActionLink<TController>(this HtmlHelper htmlHelper,
            string linkText, Expression<Action<TController>> action)
            where TController : Controller
        {
            return htmlHelper.RouteLink(linkText, ExpressionHelper2.GetRouteValues(action));
        }

        public static MvcHtmlString ActionLink<TController>(this HtmlHelper htmlHelper,
            string linkText, Expression<Action<TController>> action, object htmlAttributes)
            where TController : Controller
        {
            return htmlHelper.RouteLink(linkText, ExpressionHelper2.GetRouteValues(action), htmlAttributes);
        }

        public static MvcHtmlString ActionLink<TController>(this HtmlHelper htmlHelper,
            string linkText, Expression<Action<TController>> action, IDictionary<string, object> htmlAttributes)
            where TController : Controller
        {
            return htmlHelper.RouteLink(linkText, ExpressionHelper2.GetRouteValues(action), htmlAttributes);
        }
    }
}